import json

if __name__ == '__main__':
    corner_path = 'view_corner_select_view_focus.txt'
    out_path = 'corner_res_focus_center_view.txt'
    out_lines = []
    with open(corner_path, 'r') as fin:
        for line in fin.readlines():
            #print(line.strip())
            view_ = json.loads(line.strip())
            line = '{} {} {} {} {} {} {} {} {} {} {} {} {}'.format(view_['view'], view_['lt'][0], view_['lt'][1], view_['rt'][0], view_['rt'][1], view_['rb'][0], view_['rb'][1], view_['lb'][0], view_['lb'][1],  view_['ln'][0], view_['ln'][1], view_['rn'][0], view_['rn'][1])
            out_lines.append(line)
    with open(out_path, 'w') as fout:
        for line in out_lines:
            fout.write('{}\n'.format(line))
